Skip to content

Add agent avatar plumbing#1202

Closed
klopez4212 wants to merge 6 commits into
mainfrom
kennylopez-agent-avatar-plumbing
Closed

Add agent avatar plumbing#1202
klopez4212 wants to merge 6 commits into
mainfrom
kennylopez-agent-avatar-plumbing

Conversation

@klopez4212

@klopez4212 klopez4212 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds avatar URL/ref plumbing through managed-agent/persona/team models and desktop API types.
  • Parses lightweight imported app-avatar references without shipping the internal Goose avatar media assets.
  • Adds persona-card/runtime avatar helper coverage around the new metadata path.

Notes

  • This standalone PR drops the card-grid/profile-sidebar UI hunks that belong to the adjacent PRs.

Validation

  • cd desktop && pnpm check
  • cd desktop && pnpm typecheck
  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --check
  • git diff --check

Not Run

  • cargo test --manifest-path desktop/src-tauri/Cargo.toml persona_card --lib is blocked locally by the missing binaries/buzz-acp-aarch64-apple-darwin sidecar.

@klopez4212 klopez4212 force-pushed the kennylopez-agent-avatar-plumbing branch from 3c98661 to 67eb982 Compare June 23, 2026 16:15
@klopez4212 klopez4212 force-pushed the kennylopez-new-agent-modal branch from 558fa41 to 9efe199 Compare June 23, 2026 16:15
@klopez4212 klopez4212 changed the base branch from kennylopez-new-agent-modal to main June 23, 2026 16:15
@klopez4212 klopez4212 marked this pull request as ready for review June 23, 2026 16:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67eb982b1f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

command.env("RUST_LOG", child_rust_log_filter());
command.env("BUZZ_PRIVATE_KEY", &record.private_key_nsec);
command.env("BUZZ_RELAY_URL", &effective_relay_url);
command.env("BUZZ_RELAY_URL", &record.relay_url);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve blank relay URLs before spawning agents

For users upgrading with existing managed agents, records created before this change commonly have relay_url persisted as "" because an empty value meant “follow the active workspace relay”. Passing the raw record value here now starts local agents with an empty BUZZ_RELAY_URL (and the credential-helper URL is derived from the same empty value below), so those agents fail to connect until the user edits and saves a relay URL. Keep resolving empty/whitespace through effective_agent_relay_url when spawning legacy records.

Useful? React with 👍 / 👎.

pub display_name: String,
pub system_prompt: String,
pub avatar_data_url: Option<String>,
pub avatar_ref: Option<String>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use avatar_ref in all persona import paths

The new avatar_ref is only consumed by the single-persona dialog path; the batch and import-update paths still submit preview.avatarDataUrl. For multi-persona Markdown/pack imports where the parser now produces only avatar_ref (for example app-avatar:pollies-12) and avatar_data_url is null, every selected persona is saved without its avatar even though the preview carried one.

Useful? React with 👍 / 👎.

tellaho and others added 2 commits June 23, 2026 17:40
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Merge main into kennylopez-agent-avatar-plumbing to clear the stale Desktop Core file-size check. main and this branch independently grew nest.rs and types.rs to their caps, so the merged state tipped 1-2 lines over. Bumps the two check-file-sizes.mjs overrides (nest.rs 1447->1449, adds types.rs 1002) per the existing TEMP-override convention; no avatar logic touched.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tellaho added a commit that referenced this pull request Jun 24, 2026
Restack derive-once onto the #1202 avatar-plumbing branch and subtract
#1202's avatar-clear mechanism. The avatar is a command-derived default
icon, so it is derived once at create (resolve_created_avatar_url) and
stored as a plain Option<String>; there is no reconcile-time backfill to
guard against.

Removed:
- avatar_url_cleared: bool field and all initializer/test sites
- profile_sync_avatar_url .or_else(managed_agent_avatar_url) re-derive
- dead Fizz-retirement / legacy-recovery / command-fallback helpers
- now-unused app: &AppHandle param on reconcile_agent_profile

Leaves #1202's non-avatar plumbing intact (persona/team model fields,
app-avatar: prefix parsing, imported app-avatar handling). All three
icon-resurrection vectors are now gone.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
…ackfill (#1233)

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
…1235)

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
@tellaho

tellaho commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Cleanup summary — frankenstein trimmed 🧹

This branch grew a bit beyond its original intent: the live avatarUrl plumbing came in solid, but two fragments of the never-built selectable-avatar-sets vision got fused on as dead code. Both have now been trimmed in follow-up PRs that landed on this branch, so the diff reflects only the live feature.

What's the keeper (the live core)

resolve_created_avatar_url (agents.rs:59) with clean precedence — explicit input → persona's own avatar → runtime command fallback — resolved once at creation and persisted onto the record, so reconciliation compares against what was actually published. The avatarUrl field is woven through DB layer, relay handlers, Tauri commands, SQL migrations, and the desktop + mobile UI + e2e tests. This is real, broadly consumed, and well-shaped.

What got trimmed

Cleanup commits on this branch

#1235 — drop orphaned app-avatar: symbolic-ref machinery (9a19c2d1)
Deleted desktop/src/shared/avatars/gooseAppAvatarRefs.ts (+ test) — a parser/validator with no resolver and no id→image map anywhere in the tree. Collapsed the skip-fetch guard in profile/hooks.ts to a plain getAvatarSnapshotUrl(...), and inlined import resolution in personaDialogState.ts (the persistable-URL branch is byte-for-byte identical — same precedence, same regex). Retired the dead app-avatar: vocabulary in Rust test fixtures. The avatar_ref field stays — it's a generic opaque carrier of the avatar: frontmatter value (holds real URLs), not specific to app-avatar:.

#1236 — drop dead runtimeAvatar allowlist (5cbdf9e2)
Deleted desktop/src/shared/lib/runtimeAvatar.ts — a hardcoded allowlist of 4 runtime avatar URLs behind isKnownRuntimeAvatarUrl with zero consumers. The live runtime fallback is managed_agent_avatar_url (discovery.rs:570), a separate mechanism — this was a parallel re-implementation that never shipped.

How to verify

  1. Residual grep on the branch tree: rg "runtimeAvatar|isKnownRuntimeAvatarUrl|RUNTIME_AVATAR_URLS|GooseAppAvatar|app-avatar:" over desktop/ + mobile/ — returns nothing.
  2. git ls-tree -r kennylopez-agent-avatar-plumbing | grep -iE 'runtimeAvatar|gooseAppAvatarRefs' — both orphan files are gone.
  3. Suites green across the board (typecheck, lint, desktop-test, desktop-tauri-test, rust-tests). No failing checks on this PR — the only gate is a required review.
  4. Confirm the live path still flows: creation through resolve_created_avatar_url (agents.rs:59), runtime fallback through managed_agent_avatar_url (discovery.rs:570).

Re-adding selectable avatar sets later

See #1132 for the breadcrumb. When that feature lands, the resolver + id→image registry + picker UI get rebuilt alongside the plumbing — these allowlists/refs would be reconstructed as part of that work, not before it.

@tellaho

tellaho commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Chatted with @klopez4212 after and realized that there wasn't a lot of intent behind this particular shard of the old PR. Closing—we can address any of the related issues in the future if they come up.

@tellaho tellaho closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants